/*
* created by Administrator on 2018/12/13
* 好的代码像粥一样,是得用时间和精力熬的。
*/
const session = require('koa-session');

const CONFIG = {
    key: 'koa:sess', /** cookie的名称，可以不管 */
    maxAge: 1000*60, /** (number) maxAge in ms (default is 1 days)，cookie的过期时间，这里表示2个小时 */
    overwrite: true, /** (boolean) can overwrite or not (default true) */
    httpOnly: true, /** (boolean) httpOnly or not (default true) */
    signed: true, /** (boolean) signed or not (default true) */
};

module.exports = app => {
    app.keys = ['XIONGYI'];
    app.use(session(CONFIG, app));
};

